<?php
class ProductSellMostWidget extends CWidget
{	
	public function init()
	{
	}
	
	public function run()
	{
		$cri = new CDbCriteria;
		$cri->condition = 'empty=:empty AND visible = 1';
		$cri->params = array(':empty'=>1);
		$cri->order = 'sort ASC, id DESC';
		// $cri->limit = 6;
		$products = ProductDetail::model()->findAll($cri);

		$this->render('viewProductSellMostWidget',array('products'=>$products));	
	} 
}